<?php 
namespace Admin\Controller;
use Think\Controller;
class IndexController extends BaseController{
	function index(){
		$this->display();
	}

		function index_add(){
		$AdminOb=M('admin');
		$arr=$AdminOb->where("admin_id={$_COOKIE['adminid']} and admin_password='{$_POST['oldpassword']}'")->find();
		if ($arr) {
			echo 1;
		}else{
			echo 0;
		}
	}
	function index_upd(){
		$AdminOb=M('admin');
		if ($_POST['admin_password']==$_POST['repassword']) {
			$arr=array('admin_password'=>$_POST['admin_password']);
			$re=$AdminOb->where("admin_id={$_COOKIE['adminid']}")->data($arr)->save();
			if ($re) {
				echo 1;
			}else{
				echo 0;
			}
		}else{
			echo 0;
		}
	}
}